package com.freewater.springboot.demo.dataaccess.transaction.listener.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

@Getter
@Setter
@Entity
@Table(name = "t_order")
public class Order {
    @Id
    private Long id;
    private String userId;
    private Integer count;
    private BigDecimal amount;
    private Integer status;
    private Integer version;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "orderId", fetch = FetchType.EAGER)
    private List<OrderItem> orderItems;
}
